home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolkit / vbof_v11 / demogndr.cls < prev    next >
Text File  |  1996-03-01  |  2KB  |  87 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "Gender"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. ' the following pertain to being supported by
  11. '   VBOFCollection, VBOFObjectManager and
  12. '   VBOFEventManager
  13. Public ObjectID As Long
  14. Public ObjectChanged As Long
  15. Public ObjectAdded As Long
  16. Public ObjectDeleted As Long
  17. Public ObjectParentCount As Long
  18. Public ObjectManager As VBOFObjectManager
  19.  
  20. Public GenderCode As String
  21. Public Description As String
  22.  
  23. Public Function ObjectSortCompare(Optional SortField As Variant, Optional SortOrder As Variant, Optional CompareObject As Variant) As Long
  24. ' Support the Collection.Sort method
  25. ' Note: use the ObjectManager.ObjectSortCompare
  26. '   method for assistance
  27.  
  28.     Select Case SortField
  29.         Case "GenderCode"
  30.             ObjectSortCompare = _
  31.                 ObjectManager.ObjectSortCompare( _
  32.                     Value1:=GenderCode, _
  33.                     Value2:=CompareObject.GenderCode, _
  34.                     SortOrder:=SortOrder)
  35.         
  36.         Case "CapitalCity"
  37.             ObjectSortCompare = _
  38.                 ObjectManager.ObjectSortCompare( _
  39.                     Value1:=Description, _
  40.                     Value2:=CompareObject.Description, _
  41.                     SortOrder:=SortOrder)
  42.     End Select
  43.  
  44. End Function
  45.  
  46.  
  47.  
  48. Public Function ObjectInitializeFromRecordSet(Optional RecordSet As Variant) As Address
  49. ' Populate my variables from the RecordSet
  50. '   (in support of VBOFCollection)
  51.  
  52.     On Local Error Resume Next
  53.     
  54.     GenderCode = RecordSet("GenderCode")
  55.     Description = RecordSet("Description")
  56.     
  57.     ObjectID = RecordSet("ObjectID")
  58.  
  59.     Set ObjectInitializeFromRecordSet = Me
  60. End Function
  61.  
  62. Public Function ObjectListBoxValue() As String
  63. ' Return a String will represent this object
  64. '   in a ListBox
  65. '   (in support of VBOFCollection)
  66.  
  67.     ObjectListBoxValue = _
  68.         GenderCode & " (" & Description & ")"
  69.  
  70. End Function
  71.  
  72. Public Function ObjectNewInstanceOfMyClass() As Gender
  73. ' Return a new instance of this class
  74. '   (in support of VBOFCollection)
  75.  
  76.     Set ObjectNewInstanceOfMyClass = New Gender
  77. End Function
  78.  
  79. Public Function ObjectDataSource() As String
  80. ' Return the Data Source with which this Class is associated
  81. '   (in support of VBOFCollection)
  82.     
  83.     ObjectDataSource = "GenderCodes"
  84. End Function
  85.  
  86.  
  87.